<!DOCTYPE html>
<html lang="en">
<title>渠道用户列表</title> <#import "/layout/layout.html" as body/>
<@body.page>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<div class="row wrapper border-bottom white-bg page-heading">
	<div class="col-lg-10">
		<h2>运营管理</h2>
		<ol class="breadcrumb">
			<li><a href="#">运营管理</a></li>
			<li class="active"><strong>渠道明细列表</strong></li>
		</ol>
	</div>
</div>
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title overflow">
					<h5 class="pull-left">渠道明细列表</h5>
				</div>
				<div class="ibox-content">

					<div class="table-responsive">
						<form class="form-inline" action="to_channer_detailed" role="form" id="form" method="post" accept-charset="UTF-8">
							<div class="form-group margin-left">
								<label for="channelName">渠道二维码ID：</label> <input
									class="form-control" name="channelId" id="channelId" type="text"
									placeholder="请输入用户名" value="${channelId!''}" />
							</div>
							<div class="form-group margin-left">
								<label for="mobile">用户ID：</label> 
								<input class="form-control" id="userId" name="userId" value="${userId!''}" type="text" placeholder="请输入手机号" />
							</div>
							<div class="form-group margin-left">
								<input class="form-control" id="pageNum" type="hidden"   name="pageNum"/>
							</div>
							<button type="submit" class="btn btn-outline btn-primary" style="margin-top: 5px">确认</button>
						</form>

						<table class="table table-hover table-center dataTables-example">
							<thead>
								<tr>
									<th>ID</th>
									<th>渠道ID</th>
									<th>用户ID</th>
									<th>用户昵称</th>
									<th>用户等级</th>
								</tr>
							</thead>
							<tbody>
								<#if channerDetailed??> 
									<#list channerDetailed as channer>
									<tr>
										<td>${channer.id!}</td>
										<td>${channer.channerId!}</td>
										<td><#if channer.userInfo ??>${channer.userInfo.id!}</#if></td>
										<td><#if channer.userInfo ??>${channer.userInfo.nickName!}</#if></td>
										<td>
											<#if channer.userInfo ??>
											<#if channer.userInfo.level ==2>
												檬会员
											<#else>
												普通用户
											</#if>
											</#if>
										</td>
									</tr>
									</#list> 
								</#if>
							</tbody>
						</table>
					</div>
				</div>
				<div class="ibox-content overflow">
					<h4 class="pull-left">合计：#{pageSum!}位渠道用户 &nbsp;&nbsp;#{vipNum!}位檬会员&nbsp;&nbsp;#{userNum!}位普通用户</h4>
					<div id="copot-page" class="pull-right"></div>
				</div>
			</div>
		</div>
	</div>
</div>

<script src="${baseUrl}js/main.js"></script>
<script>
    $(document).ready(function () {
        //分页
        new Page({
            parent: $("#copot-page"),
            nowPage: #{pageNo!},
            pageSize: 10,
            totalCount: #{pageSum!},
            setting: {
                defaultPage: 7,//默认显示可点击分页的个数 Math.floor(#{pageSum}/10)
                firstPageText: "首页",
                prevPageText: "上一页",
                nextPageText: "下一页",
                lastPageText: "尾页"
            },
            callback: function (nowPage, totalPage) {
            	
            	$("#pageNum").val(nowPage);
           	 	$("#form").submit();
            }
        });
        
                 
    });
    function pageSubmit(nowPage){
    	$("#pageNum").val(nowPage);
    	$("#form").submit();
    }
    function del_channer(id){
  	   $.ajax({
  	        url: 'channer_del?id='+id,//
  	        data: "",
  	        type: 'post',
  	        cache: false,
  	        dataType: 'json',
  	        success: function (data) {
  	        	swal({
  		            title: "删除成功",
  		            html: "联系管理员",
  		            type: "success"
  		        });
  	        },
  	        error: function () {
  	            alert("页面数据加载失败！");
  	            swal({
  		            title: "删除失败",
  		            html: "联系管理员",
  		            type: "error"
  		        });
  	        }
  	    });
     }
</script>
</@body.page>
</html>